﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kokomo.PeInspector.Reflection
{
	class MetadataDocumentViewModel : AssemblyAnalyzerDocumentViewModel
	{
		public MetadataDocumentViewModel(
			AssemblyAnalyzerEditor editor,
			IAssemblyListHost assemblyListHost
			)
			: base(editor, assemblyListHost)
		{
		}

		protected override void OnCurrentDetailViewModelChanged()
		{
			base.OnCurrentDetailViewModelChanged();

			string newTitle = null;
			if (this.CurrentDetailViewModel != null)
			{
				MemberViewInfo viewInfo = this.GetMemberViewInfo(this.CurrentDetailViewModel.Object);
				newTitle = viewInfo.Heading;
			}

			this.Title = newTitle;
		}
	}
}
